package samples.d2.shapes 
{
	import flash.filters.DropShadowFilter;
	import flash.filters.GlowFilter;
	import flash.geom.Rectangle;
	import flash.utils.setInterval;
	import samples.BaseSample;
	import shapes.shapes2D.distribution.goldenRatio.GoldenRatio;
	import shapes.shapes2D.distribution.Grid;
	import shapes.shapes2D.Dot;
	import shapes.shapes2D.Square;
	
	/**
	 * @author Nicolas Barradeau
	 * http://en.nicoptere.net
	 */
	public class Square3 extends BaseSample
	{
		private var s:Square;
		private var offX:Number = 2;
		private var offY:Number = 3;
		
		public function Square3() 
		{
			
			s = new Square(0, 0, 0);
			interval = setInterval( reset, 10 )
			
		}
		
		private function reset():void
		{
			
			graphics.clear();
			graphics.lineStyle( 0,color );
			
			var angle:Number = 0;
			var total:int = 180;
			var i:int = total;
			offX = _stage.mouseX / sw;
			offY = _stage.mouseY / sh;
			while( i-- )
			{
				angle = Math.PI * 2 / total * i;
				
				s.x = sw / 2 + Math.cos( angle * offX ) * 200;
				s.y = sh / 2 + Math.sin( angle * offY ) * 200;
				s.size = 35;
				
				s.draw( graphics );
			}
			offX += GoldenRatio.RATIO *.0032;
			offY += GoldenRatio.RATIO *.002;
			
		}
		
	}

}